Skip to content

feat: Add templates for xunit.v3 #1634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2024
Merged

feat: Add templates for xunit.v3 #1634

merged 1 commit into from
Dec 30, 2024

Conversation

linkdotnet
Copy link
Collaborator

Added another template for xunit.v3.

@egil
Copy link
Member

egil commented Dec 17, 2024

Should we upgrade dependencies on the other templates too?

@egil
Copy link
Member

egil commented Dec 17, 2024

Is there any conflict between bUnits TestContext and Xunits? Haven't tested yet myself.

@linkdotnet
Copy link
Collaborator Author

Is there any conflict between bUnits TestContext and Xunits? Haven't tested yet myself.

My understanding is that you either use the static object aka TestContext.Current or via DI ITestContextAccessor - so we should be safe.

@linkdotnet
Copy link
Collaborator Author

Should we upgrade dependencies on the other templates too?

Sure why not

@linkdotnet linkdotnet force-pushed the xunitv3-templates branch 2 times, most recently from e774a7e to 043b206 Compare December 17, 2024 19:14
@linkdotnet linkdotnet force-pushed the xunitv3-templates branch 2 times, most recently from e4bd142 to 7a366f2 Compare December 17, 2024 19:26
@linkdotnet
Copy link
Collaborator Author

I did the following:

  • Added the xunit.v3 template
  • Updated dependencies
  • Removed net6.0 and net7.0 from our target framework choices as they are EOL

@linkdotnet linkdotnet requested a review from egil December 17, 2024 19:50
@linkdotnet
Copy link
Collaborator Author

Is there any conflict between bUnits TestContext and Xunits? Haven't tested yet myself.

You were right - there are conflicts.

Copy link
Member

@egil egil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent

@egil
Copy link
Member

egil commented Dec 17, 2024

Is there any conflict between bUnits TestContext and Xunits? Haven't tested yet myself.

You were right - there are conflicts.

Than we can change our default import to be:

using BunitContext = Bunit.TestContext;

@linkdotnet
Copy link
Collaborator Author

using BunitContext = Bunit.TestContext;

You mean for that specific template? It might be confusing and less verbose (especially regarding all our docs).
Therefore I opted out of this behavior.

@linkdotnet
Copy link
Collaborator Author

@egil Can we merge this or do you want to rename Bunit.TestContext to BunitTestContext in the template?
See last comment from my side

@egil
Copy link
Member

egil commented Dec 30, 2024

@egil Can we merge this or do you want to rename Bunit.TestContext to BunitTestContext in the template?

See last comment from my side

An important point of having a template is that works out of the box for the users.

For now, I guess we can just have test class examples inherit from the fqns, e.g. public class CounterTests : Bunit.TeatContext

@linkdotnet
Copy link
Collaborator Author

@egil Can we merge this or do you want to rename Bunit.TestContext to BunitTestContext in the template?
See last comment from my side

An important point of having a template is that works out of the box for the users.

For now, I guess we can just have test class examples inherit from the fqns, e.g. public class CounterTests : Bunit.TeatContext

I absolutely agree - and if it wouldn't be for v2, I also would go down the route of using a global alias (even though it hides the fact and might be confusing as well).

@linkdotnet linkdotnet merged commit f6d77e2 into main Dec 30, 2024
10 checks passed
@linkdotnet linkdotnet deleted the xunitv3-templates branch December 30, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants